// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
let root = ''
let assetsFront = 'gddn_monitor_front'
switch (process.env.NODE_TYPE) {
  case 'test':
    root = 'front'
    break
  case 'prod':
    root = 'front'
    break
  case 'pre':
    root = 'front'
    break
  default:
    root = 'front'
    break
}
module.exports = {
  build: {
    env: require('./prod.env'),
    index: path.resolve(__dirname, `../${assetsFront}/${root}/index.html`),
    assetsRoot: path.resolve(__dirname, `../${assetsFront}/${root}`),
    assetsSubDirectory: 'static',
    assetsSubFront: assetsFront,
    assetsPublicPath: './',
    productionSourceMap: false,
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],
    bundleAnalyzerReport: true
  },
  dev: {
    env: require('./dev.env'),
    port: '8080',
    ip: `local.bgy.t.pinming.org`,
    // ip: `local.pinming.net`,
    autoOpenBrowser: true,
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},
    cssSourceMap: false
  }
}
